﻿#include<iostream>
using namespace std;

//union  {//匿名联合体
//	short sHP;
//	int nHP;
//	double fHP;
//}ls;
//
//struct {//匿名结构体
//	short sHP;
//	int nHP;
//	double fHP;
//}er;

union USER {

	union {//匿名联合体
		short sHP;
		int nHP;
		double fHP;
	}ls;

	struct {//匿名结构体
		short sHP;
		int nHP;
		double fHP;
	}er;

};


int main() {
	USER* er = new USER{};

	er->er.nHP = 3500;
	er->ls.nHP = 3500;

	(*er).er.nHP = 3500;
	(*er).ls.nHP = 3500;

}